ostree_repo_read_commit_detached_metadata: Handle parent repo
authorAlexander Larsson <alexl@redhat.com>
Fri, 21 Oct 2016 08:13:54 +0000 (10:13 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 21 Oct 2016 10:50:41 +0000 (10:50 +0000)
If the detached metadata is not in the repo, try in the parent
repo if that is set.

Without this a commit will not gpg validate in the child repo

Closes: #539
Approved by: giuseppe

src/libostree/ostree-repo-commit.c

index 8dfe276f0421e8076cccd13b51fdc01f837e94a2..3d8008f7a886a860b5c2bb13121c676708797a88 100644 (file)
@@ -2044,6 +2044,12 @@ ostree_repo_read_commit_detached_metadata (OstreeRepo      *self,
       goto out;
     }
 
+  if (ret_metadata == NULL && self->parent_repo)
+    return ostree_repo_read_commit_detached_metadata (self->parent_repo,
+                                                      checksum,
+                                                      out_metadata,
+                                                      cancellable,
+                                                      error);
   ret = TRUE;
   ot_transfer_out_value (out_metadata, &ret_metadata);
  out: